import store from "../store"

import {
    INCREMENTCOUNT,
    DECREMENTCOUNT
} from '../constnant/countConst'

//累加的action
export const incrementAction = (data) => {
    return store.dispatch({
        type:INCREMENTCOUNT,
        data
    })
}

//累减的action
export const decrementAction = (data) => {
    return store.dispatch({
        type:DECREMENTCOUNT,
        data
    })
}

//等待累加的action
export const waitincrementAction = (data) => {
    return () => {
        setTimeout(() => {
            store.dispatch({
                type: INCREMENTCOUNT,
                data
            })
        }, 2000);
    }
}